#ifndef DBINT_H
#define DBINT_H
#include <vector>
#include <utility>
#include <string>
#include "article.h"

class dbinterface{
	public:
	
	virtual ~dbinterface() = default;

	virtual std::vector<std::pair<int, std::string>> listnewsgroups() = 0;
	virtual bool createnewsgroup(std::string name) = 0;
	virtual bool deletenewsgroup(int groupid) = 0;
	virtual std::pair<std::vector<std::pair<int, std::string>>, int> listarticles(int id) = 0; //XXX: Empty if group does not exist?
	virtual bool createarticle(int groupid, std::string title, std::string author, std::string text) = 0;
	virtual int deletearticle(int groupid, int articleid) = 0;  //0 for success. 1 for group not found. 2 for article not found. 
	virtual std::pair<int, article> getarticle(int groupid, int articleid) = 0; //0 for success. 1 for group not found. 2 for article not found. 
	
};
#endif
